<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="text" id="name">
    <input type="button" id="btn" value="验证啦傻逼">
    <script>
        var btn = document.getElementById('btn');
        btn.onclick = function(){
            var name = document.getElementById('name');
            var reg = /^([\u4e00-\u9fa5]{1,7}|a-z{1,14})$/i;
            if(reg.test(name.value)){
                alert('验证成功');
            }else{
                alert('验证失败');
            }
        }
    </script>
</body>
</html>